int[8] quicksort(int[8] arr,int low,int high){
	int[8] elem=arr;
	int lowIndex=low, highIndex=high;
	if(low<high){
		int tmp;
		while(low<high){
			while(low<high&& elem[high]>=elem[low]){
				high=high-1;
			}
			tmp=elem[low];
			elem[low]=elem[high];
			elem[high]=tmp;
			while(low<high&& elem[low]<=elem[high]){
				low=low+1;
			}
			tmp=elem[low];
			elem[low]=elem[high];
			elem[high]=tmp;
		}
		int pivotloc = low;
		int[8] a=quicksort(elem,lowIndex,pivotloc);
		int[8] b=quicksort(elem,pivotloc+1,highIndex);
		for(int i=0;i<8;i=i+1){
			if(i<pivotloc){
				elem[i]=a[i];
			}elif(i>pivotloc){
				elem[i]=b[i];
			}
		}
	}
	return elem;
}
void main(){
	int[8] test;
	int tmp;
	print("Please enter 8 numbers:\n");
	for(int i=0;i<8;i=i+1){
		input(tmp);
		test[i]=tmp;
	}
	int[8] res=quicksort(test,0,7);
	print("The result of the quicksort is:\n");
	for(int i=0;i<8;i=i+1){
		print(res[i]);
	}
	print("\n");	
	return;
}
